<template>
  <view class="d-pagination">
    <uni-pagination :total="total" :current="page" :page-size="pageSize" @change="handlerPageChange" title="标题文字" />
  </view>
</template>

<script setup lang="ts">
defineOptions({ name: 'DPagination' })

const props = defineProps({
  total: {
    type: Number,
    default: 0,
  },
  pageSize: {
    type: Number,
    default: 0,
  },
  page: {
    type: Number,
    default: 0,
  }
})

const $emit = defineEmits(['change'])

function handlerPageChange (val: any) {
  $emit('update:page', val.current)
  $emit('change')
}
</script>

<style scoped lang="scss">
.d-pagination {
  margin-top: 20rpx;
}
</style>
